<template>
	<view class="content">
		<view class="search-table student-plan">
			<u-table>
				<u-tr>
					<u-th>年份</u-th>
					<u-th v-for="(item,i) in schoolList" :key='i'>{{item.year}}</u-th>
				</u-tr>
				<u-tr>
					<u-td>计划数</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{item.plan_count}}</u-td>
				</u-tr>
				<u-tr>
					<u-td>投档数</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{item.cast_count}}</u-td>
				</u-tr>
				<u-tr>
					<u-td>录取数</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{item.enroll_count}}</u-td>
				</u-tr>
				<u-tr>
					<u-td>退档人数</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{item.quit_count}}</u-td>
				</u-tr>
				<u-tr>
					<u-td>退档比例</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{item.quit_scale}}%</u-td>
				</u-tr>
				<u-tr>
					<u-td>最高分</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{item.enroll_max}}</u-td>
				</u-tr>
				<u-tr>
					<u-td>平均分</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{item.enroll_avg}}</u-td>
				</u-tr>
				<u-tr>
					<u-td>最低分</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{item.enroll_min}}</u-td>
				</u-tr>
				<u-tr>
					<u-td>我的分数</u-td>
					<u-td v-for="(item,i) in schoolList" :key='i'>{{my_number}}</u-td>
				</u-tr>
			</u-table>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				schoolList: [],
				my_number:''
			}
		},
		onLoad(options) {
			this.http({
				url: `api/v1/choose_school/analyze_detail`,
				method: 'POST',
				data: {
					"analyze_type": 1,
					"school_code": options.school_code,
					"school_batch_type": 'enrollPlan',
					"page_source_type": ''
				},
				success: res => {
					if(res.errcode == 0) {
						this.schoolList = res.result.list;
						this.my_number = res.result.my_number;
					}
				},
			})
		},
		methods: {
			goto(name, item) {
				uni.navigateTo({
					url: name+"?school_code="+item.school_code
				});
			}
		}
	}
</script>

<style lang="less">
	.search-table {
		.search-href {
			color: #3a81ff;
			width: 260rpx;
		}
		.search-th {
			width: 260rpx;
		}
	}
</style>
